package com.jm.search.utils;

import com.jm.common.model.StandardReport;

import java.time.LocalDateTime;

/**
 * @Author:JianWu
 * @Date: 2025/1/21  17:49
 */
public class SearchUtils {

    /**
     * 索引前缀
     */
    public static final String INDEX = "sms_submit_log_";

    public static String getYear(){
        return LocalDateTime.now().getYear()+"";
    }

    public static String getCurrYearIndex(){
        return INDEX + getYear();
    }

    private static ThreadLocal<StandardReport> replaceThreadLocal = new ThreadLocal();

    public static void set(StandardReport report){
        replaceThreadLocal.set(report);
    }

    public static StandardReport get(){
        return replaceThreadLocal.get();
    }

    public static void remove(){
        replaceThreadLocal.remove();
    }
}
